package com.xc.controller.protol;

import com.xc.common.ServerResponse;
import com.xc.service.IPayService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;

/**
 * @author mipha
 * @version 1.0
 * @date 2019/3/18 9:04 PM
 */
@Controller
@RequestMapping("/user/pay/")
@Slf4j
public class UserPayController {

    @Autowired
    IPayService iPayService;


    /**
     *  http://localhost:8088/user/pay/juhe1.do?payType=903&payAmt=0.01
     *  第一个支付通道 juhe1
     * @param payType   902 微信 903 支付宝
     * @param payAmt
     * @return
     */
    @RequestMapping("juhe1.do")
    @ResponseBody
    public ServerResponse juhe1(@RequestParam("payType") String payType
                , @RequestParam("payAmt") String payAmt
                , HttpServletRequest request){
        log.info("发起线上支付 payType = {} payAmt = {}",payType,payAmt);
        return iPayService.juhe1(payType,payAmt,request);
    }






}
